/**
 * Created by zengyx on 16/12/17.
 */
import send from './http'
export default {
  queryCallList (data) {
    let req = {
      data: data,
      action: 'app.callSheet.queryCallSheet'
    }
    return send.fetch(req, 'post')
  },
  queryPendingCallSheet (data) {
    let req = {
      data: data,
      action: 'app.callSheet.queryPendingCallSheet'
    }
    return send.fetch(req, 'post')
  },
  getPendingCallSheetCount (data) {
    let req = {
      data: data,
      action: 'app.callSheet.getPendingCallSheetCount'
    }
    return send.fetch(req, 'post')
  },
  locationCustomer (data) {
    let req = {
      data: data,
      action: 'app.callSheet.locationCustomer'
    }
    return send.fetch(req, 'post')
  },
  callScreenLocationCustomer (data) {
    let req = {
      data: data,
      action: 'app.customer.callLocationCustomer'
    }
    return send.fetch(req, 'post')
  },
  relocationCustomer (data) {
    let req = {
      data: data,
      action: 'app.callSheet.relocationCustomer'
    }
    return send.fetch(req, 'post')
  },
  queryIvrContrail (id) {
    let req = {
      data: id,
      action: 'app.callSheet.getCdrDetail'
    }
    return send.fetch(req, 'post')
  },
  addExportMonitorTask (data) {
    let req = {
      data: data,
      action: 'app.callSheet.addExportMonitorTask'
    }
    return send.fetch(req, 'post')
  },
  exportCdrExcel (data) {
    let req = {
      data: data,
      action: 'app.excel.exportXls'
    }
    return send.fetch(req, 'post')
  },
  saveCdrMemo (data) {
    let req = {
      data: data,
      action: 'app.callSheet.saveCdrMemo'
    }
    return send.fetch(req, 'post')
  },
  getCdrInfo (data) {
    let req = {
      data: data,
      action: 'app.callSheet.getCdrInfo'
    }
    return send.fetch(req, 'post')
  },
  queryCallLabelType () {
    let req = {
      data: {},
      action: 'config.callLabel.getCallLabelType'
    }
    return send.fetch(req, 'post')
  },
  querySingleCallLabel () {
    let req = {
      data: {},
      action: 'config.callLabel.queryCallLabel'
    }
    return send.fetch(req, 'post')
  },
  queryMultiCallLabel () {
    let req = {
      data: {},
      action: 'config.callLabel.queryMultiCallLabels'
    }
    return send.fetch(req, 'post')
  },
  markCallSheet (data) {
    let req = {
      data: data,
      action: 'app.callSheet.markCallSheet'
    }
    return send.fetch(req, 'post')
  },
  getCallLabelOPHistory (data) {
    let req = {
      data: data,
      action: 'app.callSheet.getCallLabelOPHistory'
    }
    return send.fetch(req, 'post')
  },
  saveBlackList (data) {
    let req = {
      data: data,
      action: 'config.ivr.blacklist.saveBlackList'
    }
    return send.fetch(req, 'post')
  },
  reloadIvr (data) {
    let Account = data.Account
    let PBX = data.PBX
    let req = {
      data: {Account, PBX},
      action: 'config.ivr.reloadIvr'
    }
    return send.fetch(req, 'post')
  },
  removeKeyTag (data) {
    let req = {
      data: data,
      action: 'app.callSheet.removeKeyTag'
    }
    return send.fetch(req, 'post')
  },
  offonlineTrans (data) {
    let req = {
      data: data,
      action: 'app.callSheet.offonlineTrans'
    }
    return send.fetch(req, 'post')
  },
  findOneAppDic (data) {
    let req = {
      data: data,
      action: 'config.dic.findOneAppDic'
    }
    return send.fetch(req, 'post')
  },
  changeCallSheetProccessStatus (data) {
    let req = {
      data: data,
      action: 'app.callSheet.changeCallSheetProccessStatus'
    }
    return send.fetch(req, 'post')
  },
  // saveAssignCallBackAgent (data) {  // 经搜索没用上，稳定后可删除
  //   let req = {
  //     data: data,
  //     action: 'app.callSheet.saveAssignCallBackAgent'
  //   }
  //   return send.fetch(req, 'post')
  // },
  // confirmDelAllCdr (data) { // 删除查询到的未接来电记录，此功能被砍
  //   let req = {
  //     data: data,
  //     action: 'app.callSheet.delMatchedMissedCall'
  //   }
  //   return send.fetch(req, 'post')
  // },
  queryUnassignMissedCall (data) {
    let req = {
      data: data,
      action: 'app.callSheet.queryUnassignMissedPenndingCall'
    }
    return send.fetch(req, 'post')
  },
  showMissedCallInfo (data) {
    let req = {
      data: data,
      action: 'app.callSheet.showMissedCallInfo'
    }
    return send.fetch(req, 'post')
  },
  assignMissedCall (data) {
    let req = {
      data: data,
      action: 'app.callSheet.assignMissedCall'
    }
    return send.fetch(req, 'post')
  },
  assignMatchedMissedCall (data) {
    let req = {
      data: data,
      action: 'app.callSheet.assignMatchedMissedCall'
    }
    return send.fetch(req, 'post')
  },
  addMissedCDRExportTask (data) {
    let req = {
      data: data,
      action: 'app.callSheet.addMissedCDRExportTask'
    }
    return send.fetch(req, 'post')
  },
  commentCallSheetThroughCall (data, state) {
    let req = {
      data: data,
      action: 'app.callSheet.commentCallSheetThroughCall',
      action_id: Math.random(),
      sessionId: state.cti.globalLet.phone_data.userId
    }
    return send.fetch(req, 'post')
  },
  queryExportMonitorTask (data, state) {
    let req = {
      data: data,
      action: 'app.callSheet.queryExportMonitorTask'
    }
    return send.fetch(req, 'post')
  },
  addCallSheetExportTask (data, state) {
    let req = {
      data: data,
      action: 'app.callSheet.addCallSheetExportTask'
    }
    return send.fetch(req, 'post')
  },
  addCallOfflineTranscriptionTask (data, state) {
    let req = {
      data: data,
      action: 'app.callSheet.addCallOfflineTranscriptionTask'
    }
    return send.fetch(req, 'post')
  },
  getCallSheetExportTaskList (data, state) {
    let req = {
      data: data,
      action: 'app.callSheet.getCallSheetExportTaskList'
    }
    return send.fetch(req, 'post')
  },
  deleteCallSheetExportTask (data, state) {
    let req = {
      data: data,
      action: 'app.callSheet.deleteCallSheetExportTask'
    }
    return send.fetch(req, 'post')
  },
  removeExportMonitorTask (data, state) {
    let req = {
      data: data,
      action: 'app.callSheet.removeExportMonitorTask'
    }
    return send.fetch(req, 'post')
  },
  queryLatestedCallSheet (data, state) {
    let req = {
      data: data,
      action: 'app.callSheet.queryLatestedCallSheet'
    }
    return send.fetch(req, 'post')
  },
  submitAppealCall (data, state) {
    let req = {
      data: data,
      action: 'app.autoqc.submitAppeal'
    }
    return send.fetch(req, 'post')
  },
  getTranslationRecord (data, state) {
    let req = {
      data: data,
      action: 'app.callSheet.getTranslationRecord'
    }
    return send.fetch(req, 'post')
  },
  getWordSegmentation (data, state) {
    let req = {
      data: data,
      action: 'app.callSheet.getWordSegmentation'
    }
    return send.fetch(req, 'post')
  },
  updateTranslationState (data, state) {
    let req = {
      data: data,
      action: 'app.callSheet.updateTranslationState'
    }
    return send.fetch(req, 'post')
  },
  queryMyLatestCdr (data, state) {
    let req = {
      data: data,
      action: 'app.callSheet.queryMyLatestCdr'
    }
    return send.fetch(req, 'post')
  },
  /*******************金牌话术相关接口**********************/
  //检查账⼾是否启⽤了智能话务辅助功能
  checkStatus(data,state){
    let req = {
      data:data,
      action:'app.intelliCallAssist.checkStatus'
    }
    return send.fetch(req, 'post')
  },
  //根据座席或技能组ID获取话术流程
  queryDiscourse(data,state){
    let req = {
      data:data,
      action:"app.intelliCallAssist.getScriptFlows",
    }
    return send.fetch(req, 'post')
  },
  //根据话术导航ID获取流程信息
  getScriptFlowByID(data,state){
    let req = {
      data:data,
      action: "app.intelliCallAssist.getScriptFlowByID",
    }
    return send.fetch(req, 'post')
  },
  //使⽤指定的话术流程
  adoptScriptFlow(data,state){
    let req = {
      data:data,
      action:'app.intelliCallAssist.adoptScriptFlow'
    }
    return send.fetch(req, 'post')
  },
  //话术导航历史
  getScriptFlowHistory(data,state){
    let req = {
      data:data,
      action:'app.intelliCallAssist.getScriptFlowHistory'
    }
    return send.fetch(req, 'post')
  },
  //查询话术推荐列表
  getScriptRecommendations(data,state){
    let req = {
      data:data,
      action:"app.intelliCallAssist.getScriptRecommendations"
    }
    return send.fetch(req, 'post')
  },

  // 质检中 通话录音 是否自动播放
  callRecordAutoPlay(data){
    let req = {
      data:data,
      action:"config.user.updateUser"
    }
    return send.fetch(req, 'post')
  },

  getRepeatOfCall (data, state) {
    let req = {
      data: data,
      action: 'app.callSheet.getRepeatOfCall'
    }
    return send.fetch(req, 'post', 'hiddenLoading')
  }
}
